import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/index/login',
    method: 'post',
    data
  })
}

export function getInfo(userId) {
  return request({
    url: `/user/info/${userId}`,
    method: 'get'
  })
}

export function logout() {
  return request({
    url: `/index/out`,
    method: 'get'
  })
}

/**
 *   账户 修改
 */
export function update(user) {
  return request({
    url: `/user/update`,
    method: 'post',
    data:user
  })
}
/**
 *   密码修改
 */
 export function updatePssword(oldpassword,newpassword) {
  return request({
    url: `/user/updatePssword?oldpassword=${oldpassword}&newpassword=${newpassword}`,
    method: 'get'
  })
}